package user.zc.excel.data.style;

import user.zc.helper.ExcelAssistant;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;

public class IntegerDataStyle implements IStyle{
    @Override
    public StyleInfo parse(ExcelAssistant.Style style) {
        return StyleInfo.builder()
                .color(style.color()!=-1?style.color():IndexedColors.WHITE.index)
                .sort(0)
                .width(2000)
                .alignment(style.alignment()==-1?(short) HorizontalAlignment.CENTER.ordinal():style.alignment())
                .wrapText(style.wrapText())
                .font(FontInfo.builder()
                        .bold(true)
                        .height((short) 12)
                        .name("等线")
                        .color(IndexedColors.BLACK.index)
                        .build())
                .build()
                .extend(StyleInfo.create(style));
    }
}
